<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<th:block th:include="include :: head" />

<body>
    <!-- Top Bar Start -->
    <div class="topbar">
        <th:block th:include="include :: topbar" />
    </div>
    <!-- Top Bar End -->
    <!-- Left Sidenav -->
    <div class="left-sidenav">
        <th:block th:include="include :: left-sidenav" />
    </div>
    <!-- end left-sidenav-->
    <div class="page-wrapper">
        <!-- Page Content-->
        <div class="page-content">
            <div class="container-fluid">
                <!-- Page-Title -->
                <div class="row">
                    <div class="col-sm-12">
                        <div class="page-title-box">
                            <div class="float-right">
                                <ol class="breadcrumb">
                                    <li class="breadcrumb-item"><a href="javascript:void(0);">Crovex</a></li>
                                    <li class="breadcrumb-item active">操作日志</li>
                                </ol>
                            </div>
                            <h4 class="page-title">操作日志</h4>
                        </div>
                        <!--end page-title-box-->
                    </div>
                    <!--end col-->
                </div><!-- end page title end breadcrumb -->
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-body">
                                <h4 class="header-title mt-0">Contextual classes </h4>
                                <p class="text-muted mb-3">Use contextual classes to color table rows or individual
                                    cells. </p>
                                <div class="table-responsive-sm">
                                    <table class="table mb-0">
                                        <thead>
                                            <tr>
                                                <th scope="col">#</th>
                                                <th scope="col">姓名</th>
                                                <th scope="col">学号</th>
                                                <th scope="col">活动名称</th>
                                                <th scope="col">操作类型</th>
                                                <th scope="col">操作时间</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr th:class="${logStat.index % 2 == 0?'':'table-success'}"  th:each="signLog,logStat:${signLogList}">
                                                <th scope="row" th:text="${logStat.index + 1}"></th>
                                                <td class="" th:text="${signLog.realName}"></td>
                                                <td class="" th:text="${signLog.studentNo}"></td>
                                                <td class="" th:text="${signLog.taskName}"></td>
                                                <td class="" th:text="${signLog.signType==0?'签到':(signLog.signType==1?'补签':(signLog.signType==2?'评价':(signLog.signType==3?'解绑':'续费')))}"></td>
                                                <td class="" th:text="${#dates.format(signLog.timestamp,'yyyy-MM-dd HH:mm:ss')}"></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <!--end /table-->
                                </div>
                                <!--end /tableresponsive-->
                            </div>
                            <!--end card-body-->
                        </div>
                        <!--end card-->
                    </div>
                    <!--end col-->
                </div>
                <!--end row-->
            </div><!-- container -->
            <th:block th:include="include :: footer"/>
            <!--end footer-->
        </div><!-- end page content -->
    </div><!-- end page-wrapper -->
    <script type="text/javascript">
        $(function () {
            $('#unBind').on('click', function () {
                event.preventDefault();
                var ii = layer.load(0, { shade: false });
                var name = document.getElementById("name").placeholder;
                var userId = document.getElementById("userId").placeholder;
                $.ajax({
                    cache: false,
                    type: "POST",
                    url: "../action/unbind",
                    contentType: 'application/json;charset=UTF-8',
                    data: JSON.stringify({ "realName": name, "userId": userId }),
                    async: true,
                    success: function (data) {
                        console.log(data);
                        console.log(data.code);
                        layer.close(ii);
                        if (data.code == '200') {
                            layer.msg(data.name + ',解绑成功!', {
                                icon: 1,
                                time: 2000 //2秒关闭（如果不配置，默认是3秒）
                            }, function () {
                                $('.input100').val("");
                            });
                        } else {
                            layer.msg(data.msg + ',解绑失败!', {
                                icon: 2,
                                time: 2000 //2秒关闭（如果不配置，默认是3秒）
                            }, function () {
                                $('.input100').val("");
                            });
                        }
                    },
                });
            });
        })
    </script>
</body>

</html>